<section>
	<div class="page_title">
		<h2 class="fl">账号设置</h2>
	</div>

	<ul class="ulColumn2">
		<input type="hidden" name="id" value="{$data['aid']}" />
		<li>
			<span class="item_name" style="width:120px;">用户名：</span>
			<span class="username">{$data['username']}</span>
		</li>
		<li>
			<span class="item_name" style="width:120px;">密码：</span>
			<input type="password" name="password" class="textbox textbox_295" />
		</li>
		<li>
			<span class="item_name" style="width:120px;">确认密码：</span>
			<input type="password"  name="repassword" class="textbox textbox_295"/>
		</li>

		<li>
			<span class="item_name" style="width:120px;"></span>
			<input type="submit" class="link_btn account" style="margin-left: 300px"/>
		</li>
	</ul>
</section>

<script>
	$('.account').click(function () {
		//检测账号
		var id = $("input[name=id]").val();
		var username = $(".username").text();
		//密码检测
		var password = $("input[name=password]").val();
		var repassword = $("input[name=repassword]").val();
		if(password !== repassword){
			msg_warning('两次密码不一致！');
			return false;
		}
		//actionname
		var actions = 'account';
		var data = {id:id,password:password,repassword:repassword,username:username,actions:actions};
		send_data = {
			url:U('admin/User/updateuser'),
			type:'POST',
			data:data,
			dataType:'json',
		}
		send_ajax(send_data,function(res){
			if(res.status == 1){
				msg_success('修改成功','',2000);
				setTimeout(function(){
					location.href=res.data.jumpurl;
				},2000);
			}else{
				msg_error(res.message);
			}
		})
	});

	$(function(){
		//调用登陆部分的js
		$(window).keyup(function(e){
			if(e.keyCode == 13){
				$(".account").click();
			}
		})
	});
</script>